/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.server.modules.sys.service.account;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.server.common.service.TreeService;
import com.server.common.utils.StringUtils;
import com.server.modules.sys.entity.account.Account;
import com.server.modules.sys.dao.account.AccountDao;

/**
 * 会计科目管理Service
 * @author 王磊
 * @version 2016-09-14
 */
@Service
@Transactional(readOnly = true)
public class AccountService extends TreeService<AccountDao, Account> {

	public Account get(String id) {
		return super.get(id);
	}
	
	public List<Account> findList(Account account) {
		if (StringUtils.isNotBlank(account.getParentIds())){
			account.setParentIds(","+account.getParentIds()+",");
		}
		return super.findList(account);
	}
	
	@Transactional(readOnly = false)
	public void save(Account account) {
		super.save(account);
	}
	
	@Transactional(readOnly = false)
	public void delete(Account account) {
		super.delete(account);
	}
	
}